package edu.sctu.practice.class01.zhengsenwen.JavaLesson.firstday;

/**
 * Created by zhengsenwen on 2015/11/8.
 */
public class Bearing {
    /**
     * Initialize a bearing to a value from 0...359
     */
    protected Integer bearing;  //0...359

    public Bearing(Integer numb_degrees) {
        if(numb_degrees < 0 || numb_degrees > 359 ){
            throw new RuntimeException("Illegal bearing");
        }
        bearing = numb_degrees;
    }

    /**
     * Return the angle between our bearing and another.
     * May be nagative.
     *
     */
    public int angleBetween(Bearing anOther){
        return bearing - anOther.bearing;
    }

    /**
     * Created by zhengsenwen on 2015/11/19.
     */
    public static class StaticDemo {
    }
}
